import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int count = 3;
        while(count != 0){
            System.out.println("请输入你的密码，共有"+count+"次机会");
            String pass = scanner.nextLine();
            if(pass.equals("123")){
                System.out.println("登录成功");
                break;

            }else{
                System.out.println("登录失败");
            }
            count--;

        }
    }
}
